package com.wsoft.oss.enums;

import lombok.Getter;
import org.springframework.lang.Nullable;

import javax.validation.constraints.NotNull;
import java.util.HashMap;
import java.util.Map;

/**
 * @author z001
 * @Date 2024/9/26 18:39
 */
@Getter
public enum FileUpdateStatusEnum {

    /**
     * 未上传
     */
    NOT_UPLOAD(0, "未上传"),
    /**
     * 正在上传/部分上传
     */
    UPLOADING(1, "正在上传/部分上传"),
    /**
     * 已上传
     */
    UPLOADED(2, "已上传");

    private final Integer type;


    private final String bucketName;


    private static final Map<Integer, FileUpdateStatusEnum> MAPPING = new HashMap(16);


    FileUpdateStatusEnum(Integer type, String bucketName) {
        this.type = type;
        this.bucketName = bucketName;
    }

    static {
        FileUpdateStatusEnum[] var0 = values();
        for (FileUpdateStatusEnum fileSizeEnum : var0) {
            MAPPING.put(fileSizeEnum.getType(), fileSizeEnum);
        }
    }


    @NotNull
    public static FileUpdateStatusEnum resolve(@Nullable Integer value) {
        if (value != null) {
            return MAPPING.get(value);
        }
        return null;
    }

}
